<?php
/**
 * Created by PhpStorm.
 * User: 火柴
 * Date: 2016/5/28
 * GitHub: https://github.com/huaiguoguo
 * Email: 290559038@qq.com
 * Time: 20:39
 */
use yii\helpers\Html;
use yii\helpers\Url;
use yii\web\View;

use common\widgets\Nav;
use yii\widgets\Menu;

$this->registerCssFile("/css/user.css", ['options' => View::POS_END]);
$route = Yii::$app->requestedAction->uniqueId;
?>


<?php $this->beginContent('@app/views/layouts/main.php'); ?>


<div class="mian_box">
    <!--文章-->
    <div class="w1000">
        <div class="left_nav">
            <?php

            $menuItems = [
                ['label' => '我的订单', 'url' => [Url::to('index')], 'active' => in_array($route, ['user/index', 'user/order-detail'])],
                ['label' => '邀请好友', 'url' => [Url::to('user-market')]],
                ['label' => '优惠券', 'url' => [Url::to('user-coupons')]],
                ['label' => '我的地址', 'url' => [Url::to('user-address')]],
                ['label' => '修改密码', 'url' => [Url::to('user-reset-pwd')]],
                ['label' => '退出', 'url' => [Url::to('/site/logout')]],
            ];

            echo Menu::widget([
                                  'submenuTemplate' => "\n<ul>\n{items}\n</ul>\n",
                                  'items' => $menuItems,
                                  'options' => [],
                              ]);
            ?>
        </div>

        <?= $content; ?>

    </div>
    <!--文章结束-->
</div>

<?php $this->endContent(); ?>
